-
Notifications
You must be signed in to change notification settings - Fork 678
Copy-on-Write (COW) Dump Implementation for Process duplication #2813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: criu-dev
Are you sure you want to change the base?
Conversation
|
@asafpamzn There are too many patches in this pull request and it would be difficult for someone to comment on the changes. The following document provides more information on how to contribute to CRIU:
I believe Mike Rapoport (@rppt) might be able to provide some advice about the idea. |
Creating a GitHub issue with more information about the use-case and why this functionality is important will help us to understand the proposed design.
There are multiple people in the community that can provide feedback. Mike is a MM maintainer for the Linux kernel and contributed many of the patches that enable post-copy migration with userfaultfd. |
Let's start with a design doc. |
Summary
I'm implementing a COW-based live migration feature for CRIU that uses userfaultfd write-protection to track memory modifications while the process continues running. The goal is to combine it with the lazy support in order to be able to duplicate a process to remote instance while minimizing downtime compared to traditional dump modes.
Overview
High level flow
In https://github.com/asafpamzn/criu/blob/criu-cow/criu/cr-dump.c#L1720
A new parasite to do the job
https://github.com/asafpamzn/criu/blob/criu-dev/criu/cow-dump.c#L197C1-L198C1
https://github.com/asafpamzn/criu/blob/a59a151c1e2fb6edfe899ab940698c5a412f75b1/criu/pie/parasite.c#L963
Question: I want to dump small VMAs and mark in write protect only large VMAs - How can I do it? I don't fully understand how I can combine VMAs as they are all pushed to the same page image file.
Next, a new thread is getting the page faults and transfer the process.
https://github.com/asafpamzn/criu/blob/criu-cow/criu/cr-dump.c#L1728
https://github.com/asafpamzn/criu/blob/a59a151c1e2fb6edfe899ab940698c5a412f75b1/criu/cow-dump.c#L423
https://github.com/asafpamzn/criu/blob/a59a151c1e2fb6edfe899ab940698c5a412f75b1/criu/cow-dump.c#L444
Awake the source process
https://github.com/asafpamzn/criu/blob/a59a151c1e2fb6edfe899ab940698c5a412f75b1/criu/cow-dump.c#L414
I'm in the early stages of learning the code. I will be happy to some guidance and advice.
Please let me know if it makes sense. I'm most concern about how I combine the memory areas as I want to write protect only large vmas